'use strict';
function includes(collection,ch){
  for(let item of collection){
    if(item===ch)
      return true;
  }
  return false;
}

module.exports = function collectSameElements(collectionA, collectionB) {
  let result = [];
  for(let item_a of collectionA){
    for(let arrItem_b of collectionB){
      if(includes(arrItem_b,item_a)){
        result.push(item_a);
      }
    }
  }
  return result;
}
